
<%@ page import="com.pijunn.label.LabeledItem" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'labeledItem.label', default: 'Lost')}" />
		<title><g:message code="lost.list.label" default="Your Registered Items" /></title>
	</head>
	<body>
		<a href="#list-labeledItem" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
			</ul>
		</div>
		<div id="list-labeledItem" class="content scaffold-list" role="main">
			<h1><g:message code="lost.list.action.label" default="Select the Lost Item" /></h1>
			<g:if test="${flash.message}">
				<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:form action="report" method="post">
				<g:hiddenField name="wizardStep" value="${cmd.wizardStep }"/>
				<g:hasErrors bean="${cmd}">
					<ul class="errors" role="alert">
						<g:eachError bean="${cmd}" var="error">
						<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
						</g:eachError>
					</ul>
				</g:hasErrors>
				<table>
					<thead>
						<tr>
							<th><g:message code="lost.select.label" default="Select" /></th>
						
							<g:sortableColumn property="name" title="${message(code: 'labeledItem.name.label', default: 'Name')}" />
						
							<g:sortableColumn property="description" title="${message(code: 'labeledItem.description.label', default: 'Description')}" />
						
							<th><g:message code="labeledItem.label.label" default="Label" /></th>
						</tr>
					</thead>
					<tbody>
					<g:each in="${cmd.labeledItemInstanceList}" status="i" var="labeledItemInstance">
						<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
							<td><g:checkBox value="${labeledItemInstance.id}" name="itemId" checked="false"/></td>
						
							<td><g:link action="show" id="${labeledItemInstance.id}">${fieldValue(bean: labeledItemInstance, field: "name")}</g:link></td>
						
							<td>${fieldValue(bean: labeledItemInstance, field: "description")}</td>
						
							<td>${fieldValue(bean: labeledItemInstance, field: "label")}</td>
						</tr>
					</g:each>
					</tbody>
				</table>
				<div class="pagination">
					<g:paginate total="${cmd.labeledItemInstanceTotal}" />
				</div>
				<fieldset class="buttons">
					<g:submitButton name="selectButton" value="${ message(code: 'lost.button.select.label', default: 'Report') }"/>
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
